<cfset i = 0>
<div class="container">
<cfoutput query="fixtures" group="RoundNo">
	
	
	
	
	<div class="span-8 <cfif i MOD 2>last</cfif>">
		<fieldset>
			<legend>Round #RoundNo# - #DateFormat(RoundDate,"medium")#</legend>
			<cfoutput>
				
				<cfset matchStatus = ''>
		
				<!--- Determine the victor --->
				<cfif Hometeampoints GT Awayteampoints>
					<cfset matchStatus = 'defeated'>
				<cfelseif Awayteampoints GT Hometeampoints>
					<cfset matchStatus = 'lost to'>
				<cfelse>
					<cfset matchStatus = 'vs'>
				</cfif>
				
				<table class="tblResultCard">
					<tr>
						<td class="<cfif matchStatus EQ 'defeated'>victor</cfif>">
							#HomeTeamID# #HomeTeamName#
						</td>
						<td>
							#matchStatus#						
						</td>
						<td class="<cfif matchStatus EQ 'lost to'>victor</cfif>">
							#AwayTeamID# #AwayTeamName#
						</td>
						<td>
							<cfif DateCompare(RoundDate,now(),"d") LTE 0>
								
								<!--- Check if there has already been a result lodged --->
								<cfif Len(ResultID)>
									#linkTo(text="Modify Result",route="enterResults",action="scorecard",key=fixtureId,seasonId=season.seasonId)#
								<cfelse>
									#linkTo(text="Enter Result",route="enterResults",action="scorecard",key=fixtureId,seasonId=season.seasonId)#
								</cfif>					
							<cfelse>
								scheduled	
							</cfif>
						</td>
					</tr>
				</table>
				
			</cfoutput>
		</fieldset>
	</div> 	
	

<cfset i = i + 1>
</cfoutput>
</div>